{% extends 'index.html' %}
{% block content %}
    <div class="container">
        <div style="margin-bottom: 20px">
            <a class="btn btn-success" href="/user/add">
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"> </span>
                新建用户</a>
            <a class="btn btn-success" href="/user/model/form/add">
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"> </span>
                新建用户(ModelFrom版本)</a>
        </div>

        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <span class="glyphicon glyphicon-th-list" aria-hidden="true"> </span>
                用户列表
            </div>

            <!-- Table -->
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>姓名</th>
                    <th>密码</th>
                    <th>年龄</th>
                    <th>余额</th>
                    <th>入职时间</th>
                    <th>性别</th>
                    <th>所属部门</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {% for item in queryset %}
                    <tr>
                        <th>{{ item.id }}</th>
                        <th>{{ item.name }}</th>
                        <th>{{ item.pwd }}</th>
                        <th>{{ item.age }}</th>
                        <th>{{ item.account }}</th>
                        <th>{{ item.create_time|date:"Y-m-d H:i:s" }}</th>
                        <th>{{ item.get_gender_display }}</th>
                        <td>{{ item.depart.rolename }}</td>
                        <td>
                            <a class="btn btn-primary btn-xs" href="/user/{{ item.id }}/edit/">编辑</a>
{#                            <a class="btn btn-danger btn-xs" href="{% url 'user_del' %}?id={{ item.id }}">删除</a>#}
                            <a class="btn btn-danger btn-xs" href="/user/{{ item.id }}/del/">删除</a>
                        </td>
                    </tr>
                {% endfor %}

                </tbody>
            </table>

            <ul class="pagination">
                {{ page_string }}

                <li style="margin-left: 15px">

                    <form method="get" style="float: left;margin-left: -1px">
                        <div class="input-group" style="width: 100px">
                            <input type="text" name="page"
                                   style="position: relative;float: left;display: inline-block;width:100px;border-radius: 0"
                                   class="form-control" placeholder="页码">
                            <span class="input-group-btn">
                    <button style="border-radius: 0" class="btn btn-default" type="submit">跳转</button>
                </span>
                        </div>

                    </form>
                </li>
            </ul>


        </div>
    </div>
{% endblock %}